surface.CreateFont("default",15, 500, true,false,"info")
surface.CreateFont("default",15, 500, true,false,"health")
surface.CreateFont("default", 50, 500, true, false, "ammo")
surface.CreateFont("default", 25, 500, true, false, "smallammo")

local function svendbennoHud()
	local classes = {"Citizen", "Geek"}
	local Ply = LocalPlayer()
	
	if(!Ply:Team()) then return end
	if(Ply:Team() < 1) then return end
	
	local width = ScrW()
	local height = ScrH()
	local length, htext

	//Drawing Background
	draw.RoundedBox(0, (height/100)*1, (height/1000)*910, (height/100)*27, (height/100)*8, Color(0,0,0,200))
	
	//Drawing Money & Team text
	draw.SimpleText("Money: "..Ply:GetMoney(),"info",(height/100)*2, (height/100)*92, Color(255, 255,255, 255), 0, 0) 
	draw.SimpleText("Class: "..classes[Ply:Team()],"info",(height/100)*2, (height/100)*94, Color(255, 255,255, 255), 0, 0)
	
	local HealthWidth
	//Drawing the health bar
	if(Ply:Health() > 100) then 
		HealthWidth = (height/4)
	else 
		HealthWidth = ((height/4)/100) * Ply:Health()
	end
	draw.RoundedBox(0, (height/100)*2, (height/100)*96, (height/4), (height/80)*2, Color(0, 0,0, 200), 0, 0)
	draw.RoundedBox(0, (height/100)*2, (height/100)*96, HealthWidth, (height/80)*2, Color(255, 0,0, 255), 0, 0)
	
	if(Ply:Health() <= 0) then
		htext = "Dead" 
	else
		hlength = Ply:Health()
	end
	//Getting the text for the health bar
	local playerHealthto
		if(Ply:Health() <= 0) then
			playerHealthto = "dead"
		else
			playerHealthto = tostring(Ply:Health())
		end
<<<<<<< .mine
=======
		//Getting the text for the health bar
		local playerHealthto
			if(Ply:Health() <= 0) then
				playerHealthto = "Dead"
			else
				playerHealthto = tostring(Ply:Health())
			end
			
		draw.SimpleText(playerHealthto,"health",((height/100)*2)+(height/100)*12.5-string.len(hlength)/2*10, (height/100)*96+2, Color(255, 255,255, 255), 0, 0) 
			
		/* Outcommented armor bar
		draw.RoundedBox(0, (height/100)*2, (height/100)*97, (height/100)*25, (height/80)*1, Color(0, 0,0, 200), 0, 0)
		draw.RoundedBox(0, (height/100)*2, (height/100)*97, (height/100*25/100)*Ply:Armor(), (height/80)*1, Color(0, 0, 255), 0, 0)
		*/
>>>>>>> .r29
		
	draw.SimpleText(playerHealthto,"health",((height/100)*2)+(height/100)*12.5-string.len(hlength)/2*10, (height/100)*96+2, Color(255, 255,255, 255), 0, 0) 
		
	/* Outcommented armor bar
	draw.RoundedBox(0, (height/100)*2, (height/100)*97, (height/100)*25, (height/80)*1, Color(0, 0,0, 200), 0, 0)
	draw.RoundedBox(0, (height/100)*2, (height/100)*97, (height/100*25/100)*Ply:Armor(), (height/80)*1, Color(0, 0, 255), 0, 0)
	*/
	
	//Draw the ammo box if the player is alive
	if(!Ply:Alive() || Ply:Health() <= 0) then return end
		local ammo = Ply:GetActiveWeapon():Clip1()
		if(ammo == -1) then return end
			local magazine = Ply:GetAmmoCount(Ply:GetActiveWeapon():GetPrimaryAmmoType())
			local secondAmmo = Ply:GetAmmoCount(Ply:GetActiveWeapon():GetSecondaryAmmoType())
		if(ammo == 0 && magazine == 0 && secondAmmo == 0) then return end
		text = ammo.."/"..magazine
		length = string.len(text)
		
		draw.RoundedBox(0, (height/100)*29, (height/1000)*910,(length*25) + 25, (height/100)*8, Color(0,0,0,200))
		
		draw.SimpleText(text,"ammo",((height/100)*30), (height/1000)*917, Color(255, 255,255, 255), 0, 0)	
		draw.SimpleText(secondAmmo,"smallammo",((height/100)*30)+(length*25), (height/100)*92, Color(255, 255,255, 200), 0, 0)
end

//Making  the function to hide the normal hud
function hide(name)
        for k, v in pairs{"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"} do
                if name == v then return false end
        end
end

hook.Add("HUDShouldDraw", "hidedefaulthud", hide)
hook.Add("HUDPaint", "sbHud", svendbennoHud)